<%-- 
  - Author: Ismail Basha
  - Date: 4-Jan-'2012
  - Copyright Notice: TRAKHEES
  - Description: show.jsp
 --%>

<%@ include file="/WEB-INF/view/include.jsp"%>
<%@ page import="ae.pcfc.etks.online.web.*"%>
<div class="t_fin-black-txt ">

<form:form name="ServiceInfo" id="ServiceInfo" method="POST"
		modelAttribute="<%=ConstantsAdmin.ADMIN_SERVICE_INFO_MODEL_KEY %>">

	<fieldset>
		<legend>
			<spring:message code="label.service" />
		</legend>
	</fieldset>
	<div class="clear"></div>	
	<div>
		<div>
			<form:label path="strServiceNameEng">
				
				<spring:message code="label.servicename.eng" />
			</form:label>
			<div style="display:block;" class="float">${adminServiceInfo.strServiceNameEng}</div>
		</div>

		<div>
			<form:label path="strServiceNameArb">
				
				<spring:message code="label.servicename.arb" />
			</form:label>
			<div style="display:block;" class="float">${adminServiceInfo.strServiceNameArb}</div>
		</div>

		<div>
			<form:label path="defaultDepartment">
				
				<spring:message code="label.serviceowner" />
			</form:label>
			<div style="display:block;" class="float">
			<c:choose>
				<c:when
					test='${requestScope.requestContextAttribute.locale.language == "ar"}'>
					${adminServiceInfo.defaultDepartment.strDescDescA}
				</c:when>
				<c:otherwise>
					${adminServiceInfo.defaultDepartment.strDescDesc}
				</c:otherwise>
			</c:choose>
			</div>
			<div class="clear"></div>
		</div>
		<div>
			<form:label path="listServiceDepts">
				<spring:message code="label.service.dept" />
			</form:label>
			<div class="float" style="display:block;">
			<c:forEach items="${adminServiceInfo.listServiceDepts}" var="dept" varStatus="loop">
				<div class="clear">
				<c:choose>
						<c:when
							test='${requestScope.requestContextAttribute.locale.language == "ar"}'>				
							${dept.strDescDescA}<BR/>
						</c:when>
						<c:otherwise>
							${dept.strDescDesc}<BR/>
						</c:otherwise>
				</c:choose>
				</div>
			</c:forEach>
			</div>
			<div class="clear"></div>
		</div>
		<div>
			<form:label path="listServiceRoles">
				
				<spring:message code="label.service.role" />
			</form:label>
			<div class="float" style="display:block;">
			<c:forEach items="${adminServiceInfo.listServiceRoles}" var="role" varStatus="loop">
				<div class="clear">
				<c:choose>
						<c:when
							test='${requestScope.requestContextAttribute.locale.language == "ar"}'>				
							${role.strCrDescArb}<BR/>
						</c:when>
						<c:otherwise>
							${role.strCrDesc}<BR/>
						</c:otherwise>
				</c:choose>
				</div>
			</c:forEach>
			</div>	
			<div class="clear"></div>		
		</div>
		<div>
			<form:label path="strServiceType">
				<spring:message code="label.service.type" />
			</form:label>
			<div style="display:block;" class="float">
				<c:forEach items="${adminServiceTypeList}" var="type">
					<c:out value="${type.displayLabel}"></c:out>
					<form:radiobutton path="strServiceType" class="opt-input" value="${type.id}" disabled="true"/>
				</c:forEach>
			</div>
		</div>		
		<div>
			<form:label path="strDefaultService">
				<spring:message code="label.default.service" />
			</form:label>
			<div style="display:block;" class="float">
			<form:checkbox path="strDefaultService" value="Y" class="opt-input" disabled="true"/>
			</div>
		</div>
		<div>
			<form:label path="strServiceURL">
				<spring:message code="label.service.URL" />
			</form:label>
			<div style="display:block;" class="float">
			<a href="${adminServiceInfo.strServiceURL}">${adminServiceInfo.strServiceURL}</a>
			</div>
		</div>
		<div>
			<form:label path="strServiceSecRole">
				<spring:message code="label.service.security.role" />
			</form:label>
			<div style="display:block;" class="float">
			${adminServiceInfo.strServiceSecRole}
			</div>
		</div>
	</div>

	<c:if
		test="${null != adminServiceInfo.arrServiceAttributes and not empty adminServiceInfo.arrServiceAttributes}">
	<fieldset>
		<legend>
			<spring:message code="label.serviceattributes" />
		</legend>
		<div class="clear"></div>	
		<table class="t_grid-table" style="clear: both;">
			<tr class="odd ui-jqgrid-labels">
				<td class="ui-state-default ui-th-column ui-th-ltr"><spring:message
						code="label.serviceattributename.eng" /></td>
				<td class="ui-state-default ui-th-column ui-th-ltr"><spring:message
						code="label.serviceattributename.arb" /></td>
				<td class="ui-state-default ui-th-column ui-th-ltr"><spring:message
						code="label.neccessity" /></td>
			</tr>
			<c:forEach items="${adminServiceInfo.arrServiceAttributes}"
				var="service" varStatus="loop">
				<c:if test="${service.serviceAttrStatus == 'A'}">
				<c:choose>
					<c:when test="${loop.count % 2 == 0}">
						<c:set var="rowStyle" scope="page" value="odd" />
					</c:when>
					<c:otherwise>
						<c:set var="rowStyle" scope="page" value="even" />
					</c:otherwise>
				</c:choose>
				<tr class="${rowStyle}">
					<td><c:out value="${service.strServiceAttributeNameENG}" /></td>
					<td><c:out value="${service.strServiceAttributeNameARB}" /></td>
					<td><c:choose>
							<c:when
								test="${service.strNecessisty == 'M' || service.strNecessisty == 'm'}">
								<spring:message code="label.service.attr.mandatory" />
							</c:when>
							<c:otherwise>
								<spring:message code="label.service.attr.optional" />
							</c:otherwise>
						</c:choose>
					</td>
				</tr>
				</c:if>
			</c:forEach>
		</table>
	</fieldset>
	</c:if>
	</form:form>
</div>

